// 添加员工
import $http from "@/utils/request"
let data = {
	name: null,
	idNumber: null,
	gender: 'M',
	birthDate: null,
	photo: null,
	salary: null,
	joinDate: null,
	resume: null
}


export function getEmployeeList() { // 获取员工信息
	return $http.request({
		url: "/getEmployeeList",
		method: "GET",
	})
}

export function addEmployeeInfo(data) { // 添加员工信息
	return $http.request({
		url: "/addEmployeeInfo",
		method: "POST",
		data
	})
}

export function updateEmployeeInfo(id, data) { // 更新员工信息
	return $http.request({
		url: `/updateEmployeeInfo/${id}`, // 更新接口的URL包含员工ID
		method: "PUT", // 或者 "PATCH"，具体取决于您的后端API设计
		data
	})
}

export function deleteEmployeeInfo(id) { // 删除员工信息
	return $http.request({
		url: `/deleteEmployeeInfo/${id}`, // 删除接口的URL包含员工ID
		method: "DELETE"
	})
}

export function getEmployeeById(id) { // 获取对应员工信息
	return $http.request({
		url: `/getEmployeeById/${id}`,
		method: "GET"
	})
}

export function getEmployeeByName(name) {
	return $http.request({
		url: `/getEmployeeByName/${name}`,
		method: "GET"
	})
}